#include "config.h"
#include <QSettings>

config::config()
{
    QSettings *settings = new QSettings(PROGRAM_SETTINGS, QSettings::IniFormat);

    settings->beginGroup("mainwindow");
    settings->setValue("size", 1);
    settings->setValue("fullScreen", 2);
    settings->endGroup();

    settings->beginGroup("outputpanel");
    settings->setValue("visible", true);
    settings->endGroup();

    settings->setValue("mainwindow/fullScreen", 68);

    int i;
    bool b;
    i = settings->value("mainwindow/size", 1024).toInt();   // returns 58
    qDebug()<<"mainwindow/size:"<<i;
    i = settings->value("mainwindow/fullScreen", 1024).toInt();   // returns 1024
    qDebug()<<"mainwindow/fullScreen:"<<i;
    b = settings->value("outputpanel/visible").toBool();         // returns 0
    qDebug()<<"outputpanel/visible:"<<b;
}
